let baseURL = "https://gvewgccw.lc-cn-n1-shared.com"

export const $http = (url, method="GET",data={}) =>{
	return new Promise((resolve, reject)=>{
		uni.request({
			url: baseURL + url,
			method,
			header:{
				"X-LC-Id": "GvEWgCcWTA3u30Saxy7erHYa-gzGzoHsz",
				"X-LC-Key": "hzA8VSXaE0EusOayVQ2iukAR",
				"Content-Type": "application/json" 
			},
			data,
			success(res) {
				// console.log(res)
				resolve(res.data)
			},
			fail: (err) =>{
				reject(err)
			}
		})
	})
}

export const $get = (url,data={}) =>{
	return $http(url, "GET", data)
}

export const $post = (url,data={}) =>{
	return $http(url, "POST", data)
}

export const $put = (url,data={}) =>{
	return $http(url, "PUT", data)
}